
package jfireeagle;

import java.util.*;


public class LocationHierarchy 
{
	private Location bestGuess;
	private List<Location> locations = new ArrayList<Location>();
	private String timeZone;
	
	public LocationHierarchy()
	{
		super();
	}
	
	public Location getBestGuess()
	{
		return bestGuess;
	}

	public void setBestGuess(Location bestGuess)
	{
		this.bestGuess = bestGuess;
	}


	public Location getBestGuessLocation()
	{
		return bestGuess;
	}

	public List<Location> getLocations()
	{
		return locations;
	}

	public void addLocation(Location l)
	{
		this.getLocations().add(l);
		if (l.isBestGuess())
		{
			this.bestGuess = l;
		}
	}


	public void setLocations(List<Location> locs)
	{
		this.locations = locs;
	}

	public String getTimeZone()
	{
		return timeZone;
	}

	public void setTimeZone(String tz)
	{
		this.timeZone = tz;
	}
	
	public TimeZone getTimeZoneObject()
	{
		if ( (this.timeZone == null) || (this.timeZone.length() == 0) )
		{
			return null;
		}
		return TimeZone.getTimeZone(this.timeZone);
	}

	
	
}
